<?php
  require(dirname(__FILE__)."/global.php");
  require(ROOT."/admin/isLogin.php");
  
  $submit = $_POST['submit'];
  if(isset($submit))
  {
      $dels = $_POST['del'];
      foreach($dels as $del)
      {
          $sql = "delete from talking_bar where BarID = '$del'";
          $db->execute($sql);
      }
      $smarty->assign('tip','提交成功');
  }
  $sql ="SELECT tb.*,tu.UserName,tc.CateName FROM talking_bar tb,talking_user tu,talking_cate tc WHERE (tb.CateID IS NOT NULL OR tb.CateID <> '') AND tb.BarAdmin = tu.UserID AND tb.CateID = tc.CateID";
  $bars = $db->query($sql);
      
  $smarty->assign('bars',$bars);
  $smarty->display('bar.html');
  $db->close();
?>
